Repository navigation
Share an elastic SFTP connection pool; faster, chunked initial sync - #21
Merged
Merged
Conversation
…erns. Real-time uploads now go through one pool (default max 6, idle connections closed after 60s, one kept warm) instead of one permanent connection per pattern. Changes are queued and coalesced per file. The initial sync scans each directory once, splits large directories into chunks and uploads the largest first, so the work is spread evenly over the connections whatever the mix of extensions. It reports files done out of total every 5 seconds and in the status bar. New settings InitialSyncWorkers (default 20) and MaxConnections (default 6). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Try the delete and ignore only 'file not found' (falling back to an existence check if the server reports a missing file as another failure), saving a round trip per existing file. Any other delete failure still stops the upload, so a replaced file can never keep stale bytes at its end. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Each search pattern had its own permanent SFTP connection (about 20 idle connections per user), plus about 20 more during the initial sync. Many developers share one server, so this was a lot of connections. The initial sync was also unbalanced: work was split per (directory, pattern), so one directory with thousands of files was a single worker's job while the rest sat idle.
What changed
RemoteSync) now handles all patterns, replacing one per pattern.SftpConnectionPool): connections open only when work needs them, up toMaxConnections(default 6), and idle ones close after 60s. One is kept warm and kept alive. Changes are queued and coalesced per file, the same file is never uploaded on two connections at once, and directory create/delete/rename wait for earlier uploads.InitialSyncWorkers(default 20) connections. A retry resumes at the file that failed. Stopping the sync now stops the workers.Existscheck: it triesDeleteFileand ignores only "file not found", with anExistsfallback for servers that report that differently. Any other delete failure still stops that upload, so a replaced file cannot keep stale bytes at its end.X of Y files uploaded (Z%)every 5 seconds, the status bar shows the same, and a final line gives the elapsed time.InitialSyncWorkersandMaxConnections. The consoleSFTPSyncapp uses the new engine too.Behaviour changes
Testing
Run against a slow, shared VMS server with about 15,500 files in 59 directories, 20 initial sync connections:
Exists)Exists)Throughput is flat to the end, so there is no tail from large directories. The server is the limiting factor. The solution builds with no errors or warnings. There are no automated tests in the repo; the real-time paths (branch switch, delete, rename) were not exercised in these runs.
Not included: the new settings are not in
docs/sftpsyncui.html, and there is no skip-unchanged-files optimisation.🤖 Generated with Claude Code